package com.zerodg.zdutil.util.exception;

import io.swagger.annotations.ApiModelProperty;
import org.springframework.stereotype.Component;

/**
 * @program: eroot
 * @description: .
 * @author: ztz-prince
 * @create:
 * @date:2018-12-22-23:26
 **/

@Component
public class ResultInfo<T> {

    public ResultInfo() {
    }

    public ResultInfo(String errCode, Object message) {
        this.errCode = errCode;
        this.message = message;
    }


    public ResultInfo(T data) {
        this.data = data;
    }

    /**
     * 错误代码
     */
    @ApiModelProperty(value = "错误代码", name = "errCode", dataType = "String")
    private String errCode;

    /**
     * 消息
     */
    @ApiModelProperty(value = "消息", name = "message", dataType = "String")
    private Object message;



    /**
     * 返回数据
     */
    @ApiModelProperty(value = "返回数据", name = "data", dataType = "Object")
    private T data;

    /**
     * 错误代码
     */
    @ApiModelProperty(value = "错误代码", name = "data", dataType = "Object")
    private String Code;

    public void setCode(String code) {
        Code = code;
    }

    public String getCode() {
        return Code;
    }

    /**
     * 返回 错误代码
     */
    public String getErrCode() {
        return errCode;
    }

    /**
     * 设置 错误代码
     */
    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    /**
     * 返回 消息
     */
    public Object getMessage() {
        return message;
    }

    /**
     * 设置 消息
     */
    public void setMessage(Object message) {
        this.message = message;
    }

    /**
     * 设置 消息
     */
    public void setMessage(String str) {
        this.message = str;
    }


    /**
     * 返回 返回数据
     */
    public T getData() {
        return data;
    }

    /**
     * 设置 返回数据
     */
    public void setData(T data) {
        this.data = data;
    }
}
